<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOffersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('offers', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id')->unsigned();
            $table->string('title'); // 供应产品标题
            $table->integer('primary_category_id'); // 主分类 ID
            $table->integer('secondary_category_id'); // 次分类 ID
            $table->decimal('price', 10, 2); // 价格
            $table->string('unit'); // 单位
            $table->integer('amount'); // 数量
            $table->integer('minimum_order'); // 最小起订量

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('offers');
    }
}
